<?php
/**
 * User:chendenan
 * Created On 2022/3/21 0021 15:05
 */
namespace app\common\lib;
class Show{
    /**
     * @param $data
     * @param $message
     * @return \think\response\Json
     */
    public static function success($data=[],$message="ok"){
        $result = [
            "status" => config("status.success"),
            "message" => $message,
            "result" => $data,
        ];
        return json($result);
    }

    /**
     * @param $data
     * @param $message
     * @param $status
     * @return \think\response\Json
     */
    public static function error($message="error",$status = 0,$data=[]){
        $result = [
            "status" => $status,
            "message" => $message,
            "result" => $data,
        ];
        return json($result);
    }
}